   package com.zhu.cloudspring.controller;

   import com.zhu.cloudspring.entity.Order;
   import com.zhu.cloudspring.service.OrderService;
   import org.springframework.beans.factory.annotation.Autowired;
   import org.springframework.web.bind.annotation.*;

   import java.math.BigDecimal;

   @RestController
   @RequestMapping("/api/orders")
   public class OrderController {

       @Autowired
       private OrderService orderService;
/**
 * 模拟创建订单短信通知
 *
 * @param userId
 * @param phoneNumber
 * @param orderAmount
 * @param consignee
 * @return com.zhu.cloudspring.entity.Order
 * @author zhuwanyi
 * @create 2024/12/16
 **/

@PostMapping
       public Order createOrder(@RequestParam int userId, 
                                @RequestParam String phoneNumber, 
                                @RequestParam BigDecimal orderAmount,
                                @RequestParam String consignee) {
           return orderService.createOrder(userId, phoneNumber, orderAmount, consignee);
       }
   }
   